<div class="al-modal-view">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" ng-click="cancel()">
      <span aria-hidden="true" class="glyphicon glyphicon-remove"></span>
      <span class="sr-only">Close</span>
    </button>
    <h4 class="modal-title ok-color">{{modalTitle}}</h4>
  </div>
  <div class="modal-body">
    <ng-form name="modalForm" class="form-horizontal form-validation" role="form">
      <div class="form-group">
        <label class="col-sm-3 control-label">上线城市</label>
        <div class="col-sm-8">
          <select ng-model="data.city" class="form-control"
                  ng-options="option.value as option.name for option in modalCityList"></select>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">商品名称<span class="attr-need">*</span></label>
        <div class="col-sm-8">
          <input class="form-control" ng-model="data.title" type="text"
                 ng-required="true" name="name"
                 placeholder="产品名称" maxlength="32"/>
          <div class="help-block with-errors"
               ng-if="modalForm.name.$invalid && !modalForm.name.$pristine">
            名称不可为空
          </div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">所需积分<span class="attr-need">*</span></label>
        <div class="col-sm-8">
          <input type="number"  name="minPrice" required
                 class="form-control" ng-model="data.score">
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">位置<span class="attr-need">*</span></label>
        <div class="col-sm-8">
          <input class="form-control" ng-model="data.displayOrder" type="number"
                 ng-required="true" name="displayOrder"
                 placeholder="序号" maxlength="32"/>
          <div class="help-block with-errors"
               ng-if="modalForm.displayOrder.$invalid && !modalForm.displayOrder.$pristine">
            序号不可为空
          </div>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">描述</label>
        <div class="col-sm-8">
            <textarea class="form-control" ng-model="data.description" cols="3" maxlength="1024"
                      placeholder="描述"></textarea>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">内容</label>
        <div class="col-sm-8">
            <textarea class="form-control" ng-model="data.content" cols="6" maxlength="1024"
                      placeholder="内容"></textarea>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">状态</label>
        <div class="col-sm-8">
          <nobr>
            <label class="ui-radio" ng-repeat="option in qgyGoodStatusList">
              <input name="status" ng-value="option.value" type="radio" ng-model="data.enabled">
              <span>{{option.name}}</span>
            </label>
          </nobr>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">图片</label>
        <div class="col-sm-8">
          <div class="input-group">
            <input type="text"  name="thumb" class="form-control" ng-model="data.thumb">
            <span class="input-group-addon" ng-click="showPhotoUpload=!showPhotoUpload">
                    <i class="glyphicon glyphicon-upload"></i>
                  </span>
          </div>
        </div>
      </div>
      <div class="form-group" ng-if="data.thumb">
        <div class="col-sm-8 col-sm-offset-3">
          <div class="wf-thumbnail-container">
            <img ng-src="{{data.thumb}}" class="wf-thumbnail" alt="找不到该图片">
          </div>
        </div>
      </div>
      <div class="form-group" ng-show="showPhotoUpload">
        <div class="col-sm-8 col-sm-offset-3">
          <input id="photo-upload-input" class="file" name="file" type="file" data-min-file-count="1">
        </div>
      </div>
    </ng-form>
  </div>
  <div class="modal-footer">
    <button class="btn btn-warning no-border" type="button" ng-click="cancel()">取消</button>
    <button class="btn btn-primary no-border" type="button" ng-click="confirm()" ng-disabled="modalForm.$invalid">确定</button>
  </div>
</div>